# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2022年11月14日
"""
from docx import Document
from docx.enum.style import WD_STYLE_TYPE

document = Document()
# styles = document.styles
#
# paragraph_styles = [s for s in styles if s.type == WD_STYLE_TYPE.PARAGRAPH]
# for style in paragraph_styles:
# 	print(style)
# 	print(style.name)



# style = document.styles['Body Text']
#
# style.hidden = False
# style.quick_style = True
# style.priority = 1

# latent_styles = document.styles.latent_styles
# print(len(latent_styles))
# latent_style_names = [ls.name for ls in latent_styles]
# for i in latent_style_names:
# 	print(i)
#
# latent_quote = latent_styles['Quote']
# print(latent_quote.priority)
# print(latent_quote)

latent_styles = document.styles.latent_styles
latent_styles.default_to_locked = True
# latent_style = latent_styles['List Bullet']
# print(latent_style)
latent_style = latent_styles.add_latent_style('List Bullet')
latent_style.hidden = False
latent_style.priority = 2
latent_style.quick_style = True

document.save("09WorkingWithStyle.docx")



